scale: Hide internal structure from a11y
authorMatthias Clasen <mclasen@redhat.com>
Wed, 21 Oct 2020 18:53:17 +0000 (14:53 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 21 Oct 2020 18:53:17 +0000 (14:53 -0400)
According to section 7.1 of WAI-ARIA, the slider role
has the "Children presentational" characteristic, which
indicates that children should not be represented in
the a11y tree, which makes sense, since these are all
just internal gizmos.

gtk/gtkscale.c

index d9928636cf6cede4c3eac91e89f2a6dc5856c29f..af17b39af28489d19d23c503157a2946fafd42d3 100644 (file)
@@ -1698,12 +1698,13 @@ gtk_scale_add_mark (GtkScale        *scale,
     {
       if (!priv->top_marks_widget)
         {
-          priv->top_marks_widget = gtk_gizmo_new ("marks",
-                                                  gtk_scale_measure_marks,
-                                                  gtk_scale_allocate_marks,
-                                                  NULL,
-                                                  NULL,
-                                                  NULL, NULL);
+          priv->top_marks_widget = gtk_gizmo_new_with_role ("marks",
+                                                            GTK_ACCESSIBLE_ROLE_NONE,
+                                                            gtk_scale_measure_marks,
+                                                            gtk_scale_allocate_marks,
+                                                            NULL,
+                                                            NULL,
+                                                            NULL, NULL);
 
           gtk_widget_insert_after (priv->top_marks_widget,
                                    GTK_WIDGET (scale),
@@ -1716,12 +1717,13 @@ gtk_scale_add_mark (GtkScale        *scale,
     {
       if (!priv->bottom_marks_widget)
         {
-          priv->bottom_marks_widget = gtk_gizmo_new ("marks",
-                                                     gtk_scale_measure_marks,
-                                                     gtk_scale_allocate_marks,
-                                                     NULL,
-                                                     NULL,
-                                                     NULL, NULL);
+          priv->bottom_marks_widget = gtk_gizmo_new_with_role ("marks",
+                                                               GTK_ACCESSIBLE_ROLE_NONE,
+                                                               gtk_scale_measure_marks,
+                                                               gtk_scale_allocate_marks,
+                                                               NULL,
+                                                               NULL,
+                                                               NULL, NULL);
 
           gtk_widget_insert_before (priv->bottom_marks_widget,
                                     GTK_WIDGET (scale),